#@adminLayout()
#define main()
<div class="card">
    <div class="card-header">
        <h2 class="card-title text-info">历史数据</h2>
        <div class="progress">
            <div class="progress-bar bg-success" role="progressbar" style="width: 100%" aria-valuenow="100"
                 aria-valuemin="0"
                 aria-valuemax="100"></div>
        </div>
        <small class="card-subtitle">
            <form data-pjax id="jmisForm" action="/admin/ciis/sensordata" method="get">
                <div class="modal fade" id="modal-large" tabindex="-1">
                    <div class="modal-dialog modal-lg">
                        <div class="modal-content">
                            <div class="modal-header">
                                <h5 class="modal-title pull-left"><i class="zmdi zmdi-search zmdi-hc-fw"></i>模糊查询条件
                                </h5>
                            </div>
                            <input type="hidden" name="p" id="p">
                            <input type="hidden" name="s" id="s" value="#(s)">
                            <div class="modal-body">
                                <div class="card-block">
                                    <div class="row">

                                    </div>

                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="submit" class="btn btn-secondary btn--icon-text waves-effect"><i
                                        class="zmdi zmdi-search"></i> 查询
                                </button>
                                <button id="closeModal" type="button"
                                        class="btn btn-secondary btn--icon-text waves-effect"
                                        data-dismiss="modal"><i
                                        class="zmdi zmdi-close"></i> 关闭
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </small>
    </div>
    <div class="card-block" style="overflow: auto">
        <table class="table table-hover table-sm mb-0">
            <thead>
            <tr class="text-info">
                <th>
                    <div>企业</div>
                </th>
                <th>
                    <div>设备</div>
                </th>
                <th>
                    <div>空气温度</div>
                </th>
                <th>
                    <div>空气湿度</div>
                </th>
                <th>
                    <div>光照强度</div>
                </th>
                <th>
                    <div>风速</div>
                </th>
                <th>
                    <div>风向</div>
                </th>
                <th>
                    <div>降雨量</div>
                </th>
                <th>
                    <div>土壤温度</div>
                </th>
                <th>
                    <div>土壤湿度</div>
                </th>
                <th>
                    <div>创建时间</div>
                </th>
            </tr>
            </thead>
            <tbody id="jmisTable">
            #for(x : page.getList()??)
            <tr>
                <td>
                    <div title="#(x.enterprise_code)">#(x.enterprise_code)</div>
                </td>
                <td>
                    <div title="#(x.equipment_code)">#(x.equipment_code)</div>
                </td>
                <td>
                    <div title="#(x.air_temperature)">#(x.air_temperature)</div>
                </td>
                <td>
                    <div title="#(x.air_humidity)">#(x.air_humidity)</div>
                </td>
                <td>
                    <div title="#(x.light_intensity)">#(x.light_intensity)</div>
                </td>
                <td>
                    <div title="#(x.wind_speed)">#(x.wind_speed)</div>
                </td>
                <td>
                    <div title="#(x.wind_direction)">#(x.wind_direction)</div>
                </td>
                <td>
                    <div title="#(x.rainfall)">#(x.rainfall)</div>
                </td>
                <td>
                    <div title="#(x.soil_temperature)">#(x.soil_temperature)</div>
                </td>
                <td>
                    <div title="#(x.soil_moisture)">#(x.soil_moisture)</div>
                </td>
                <td>
                    <div title="#(x.soil_moisture)">#(x.create_time)</div>
                </td>
            </tr>
            #end
            </tbody>
        </table>
        #@adminPaginate(page, "/admin/ciis/sensordata")
    </div>
</div>
#end
<script src="/assets/app/table.js?v=#(resource_version)"></script>
<script>
    $("#jmisTable tr").each(function () {
        $(this).children("td").each(function () {
            if (this.hasAttribute("data-column") && 'undefined' !== $(this).data("column")) {
                if (!isEmpty($(this).children("a"))) {
                    var text = $(this).children("a").text().replace(/[\r\n\t\s]/g, "");//去掉回车换行空格和制表位
                    text = text.toString().length > 12 ? text.substring(0, 12) + "..." : text;
                    $(this).children("a").text(text);
                } else {
                    var text = $(this).text().replace(/[\r\n\t\s]/g, "");//去掉回车换行空格和制表位
                    text = text.toString().length > 12 ? text.substring(0, 12) + "..." : text;
                    $(this).children("div").text(text);
                }
                var t = $(this).parent().children("td[data-name='" + $(this).data('column') + "']");
                if (t.length > 0) {
                    t.replaceWith(this)
                } else {
                    $(this).remove();
                }
            }
        })
    })
</script>